<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<form>
			用户名：<input type="text" name="username" id="input1"/><br />
			密码：<input type="password" name="userpwd"/><br />
			重复密码：<input type="password" name="userpwd2"/><br />
			邮箱：<input type="email" name="userpwd2"/><br />
			电话：<input type="tel" name="userpwd2"/><br />
			<button type="submit">提交</button>
			<button type="reset">重置</button>
		</form>
		<script>
			// onfocus 获得焦点
			input1.onfocus = function(){
				var obj = event.target;
				obj.style.backgroundColor = "lightblue";
			}
			
			// onblur 失去焦点
			input1.onblur = function(){
				var obj = event.target;
				obj.style.backgroundColor = "white";
			}
		</script>
	</body>
</html>
